package com.jinbo.footmessage.utils;

import android.graphics.Bitmap;

import com.baidu.mapapi.map.BitmapDescriptor;
import com.baidu.mapapi.map.BitmapDescriptorFactory;
import com.baidu.mapapi.map.Marker;
import com.baidu.mapapi.map.Overlay;

/**
 * Created by Jinbo on 2015/8/29.
 */
public class MyOverlay {
    private Overlay overlay;
    public MyOverlay(Overlay overlay)
    {
        this.overlay=overlay;
    }
    public void setICon(Bitmap bit)
    {
        BitmapDescriptor bitmap = BitmapDescriptorFactory.fromBitmap(bit);
        if(((Marker)overlay).getIcon()!=null&&((Marker)overlay).getIcon()!=bitmap)
             ((Marker)overlay).setIcon(bitmap);
    }

    public Overlay getOverLay()
    {
        return overlay;
    }

    public void setIndex(int index)
    {
        ((Marker)overlay).setZIndex(index);
    }

    public void removeOverlay()
    {
        overlay.remove();
    }
}
